package com.rocky.crm.pojo;

import java.io.Serializable;

/**
 * order_item
 *
 * @author
 */
public class OrderItem implements Serializable {
	private Integer id;

	/**
	 * 数量
	 */
	private Integer num;

	/**
	 * 单位
	 */
	private String unit = "元";

	/**
	 * 单价
	 */
	private Double unitPrice;

	/**
	 * 金额
	 */
	private Double price;

	/**
	 * 订单
	 */
	private Integer ordersId;

	/**
	 * 产品
	 */
	private Integer productId;

	/**
	 * 产品
	 */
	private Product product;

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	private static final long serialVersionUID = 1L;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getNum() {
		return num;
	}

	public void setNum(Integer num) {
		this.num = num;
	}

	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	public Double getUnitPrice() {
		return unitPrice;
	}

	public void setUnitPrice(Double unitPrice) {
		this.unitPrice = unitPrice;
	}

	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public Integer getOrdersId() {
		return ordersId;
	}

	public void setOrdersId(Integer ordersId) {
		this.ordersId = ordersId;
	}

	public Integer getProductId() {
		return productId;
	}

	public void setProductId(Integer productId) {
		this.productId = productId;
	}

	@Override
	public boolean equals(Object that) {
		if (this == that) {
			return true;
		}
		if (that == null) {
			return false;
		}
		if (getClass() != that.getClass()) {
			return false;
		}
		OrderItem other = (OrderItem) that;
		return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
				&& (this.getNum() == null ? other.getNum() == null : this.getNum().equals(other.getNum()))
				&& (this.getUnit() == null ? other.getUnit() == null : this.getUnit().equals(other.getUnit()))
				&& (this.getUnitPrice() == null ? other.getUnitPrice() == null : this.getUnitPrice().equals(other.getUnitPrice()))
				&& (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
				&& (this.getOrdersId() == null ? other.getOrdersId() == null : this.getOrdersId().equals(other.getOrdersId()))
				&& (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId()));
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
		result = prime * result + ((getNum() == null) ? 0 : getNum().hashCode());
		result = prime * result + ((getUnit() == null) ? 0 : getUnit().hashCode());
		result = prime * result + ((getUnitPrice() == null) ? 0 : getUnitPrice().hashCode());
		result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
		result = prime * result + ((getOrdersId() == null) ? 0 : getOrdersId().hashCode());
		result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode());
		return result;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append(getClass().getSimpleName());
		sb.append(" [");
		sb.append("Hash = ").append(hashCode());
		sb.append(", id=").append(id);
		sb.append(", num=").append(num);
		sb.append(", unit=").append(unit);
		sb.append(", unitPrice=").append(unitPrice);
		sb.append(", price=").append(price);
		sb.append(", ordersId=").append(ordersId);
		sb.append(", productId=").append(productId);
		sb.append(", serialVersionUID=").append(serialVersionUID);
		sb.append("]");
		return sb.toString();
	}
}